#include <cassert>
#include "UnaryExpr.h"
#include "MosParser.h"

using namespace moses;

UnaryExpr::UnaryExpr(Expr *pLeft, int op)
	: m_pLeft(pLeft), m_op(op)
{

}

UnaryExpr::~UnaryExpr()
{
	delete m_pLeft;
}

Value UnaryExpr::Evaluate(Runtime *pEnv)
{
	switch (m_op)
	{
		case T_MINUS:	return -m_pLeft->Evaluate(pEnv);
		default:		assert(false); return Value(Type::NONE);
	}

}
